package com.coco.group.mapper;

import com.coco.group.pojo.TbGroupBuyGoods;
import com.coco.group.pojo.TbGroupBuyRecord;
import com.coco.group.vo.GroupBuyRecordVo;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Package: com.coco.group.mapper
 * @Author: 张dy
 * @Date: Created in 2021/7/29 下午 8:05
 */
@Mapper
public interface GroupBuyRecordMapper {

    List<TbGroupBuyRecord> findAll();

    List<TbGroupBuyRecord> search(GroupBuyRecordVo groupBuyRecordVo);

    void deleteById(Integer id);

    /**
     * 添加拼团记录
     * @param record
     */
    void addRecord(TbGroupBuyRecord record);

    /**
     *通过邀请码得到拼团记录
     */
    TbGroupBuyRecord findByCode(String code);

    TbGroupBuyRecord findByOrderId(String tradeNo);

    void changeJoinNum(Long id);

    void changeStatusToSuccess(Long id);

    /**
     * 根据邀请码查询单条
     * @param code
     * @return
     */
    TbGroupBuyRecord findByInvitationCode(String code);
}
